home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / Rexx / editnode.rexx < prev    next >
OS/2 REXX Batch file  |  1994-08-29  |  2KB  |  41 lines

  1. /* editnode.rexx                                                        */
  2. /* by Edd Dumbill                                                       */
  3. /* 2 July 1994                                                          */
  4. /* grabs a document from Heddley into GoldED                            */
  5. /* use this macro as a basis for interfacing with other aynschronous    */
  6. /* text editors.                                                        */
  7.  
  8. OPTIONS RESULTS                             /* enable return codes      */
  9.  
  10. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ?  */
  11.     address 'GOLDED.1'
  12.  
  13. 'LOCK CURRENT'                              /* lock GUI, gain access    */
  14. OPTIONS FAILAT 6                            /* ignore warnings          */
  15. SIGNAL ON SYNTAX                            /* ensure clean exit        */
  16. SIGNAL ON FAILURE                           /* trap Heddley errors      */
  17.  
  18. address 'HEDDLEY.1'                         /* talk to Heddley          */
  19. EDIT SAVETEXT 'T:temp_node'         /* save document to temporary file  */
  20. lock                                /* lock Heddley's front panel       */
  21. address 'GOLDED.1'                          /* talk to GoldED           */
  22. open new 't:temp_node'                      /* load in document         */
  23.  
  24.  
  25. 'UNLOCK'                                  /* VERY important: unlock GUI */
  26. EXIT                                        /* quit this macro          */
  27.  
  28. SYNTAX:                                     /* ARexx error...           */
  29.  
  30. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) /* report it...          */
  31. UNLOCK                                      /* unlock GUI               */
  32. EXIT                                        /* exit                     */
  33.  
  34. FAILURE:                                    /* Heddley error...         */
  35. ERRV=address().LASTERROR                    /* get name of error var.   */
  36. SAY "Error:" VALUE(ERRV)                    /* report the error         */
  37. ADDRESS GOLDED.1                            /* talk to GoldED           */
  38. UNLOCK                                      /* unlock GUI               */
  39. EXIT                                        /* exit                     */
  40.  
  41.